import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createPinia } from 'pinia'
import router from './router'
import { setupRouterGuard } from './router/guard'
import permission from './directives/permission'

// 设置路由守卫
setupRouterGuard(router)

// 创建应用实例
const app = createApp(App)

// 配置 Element Plus
app.use(ElementPlus)

// 配置 Pinia
const pinia = createPinia()
app.use(pinia)

// 配置路由
app.use(router)

// 配置权限指令
app.use(permission)

// 挂载应用
app.mount('#app')
